﻿@using Orchard.ContentManagement
@using Orchard.Utility.Extensions
@{
    ContentItem contentItem = Model.ContentItem;
    var typeDisplayName = contentItem.TypeDefinition.DisplayName ?? contentItem.ContentType.CamelFriendly();
    var typeName = contentItem.TypeDefinition.Name;
}

<section ng-controller="GeneralDetailCtrl" >
    <header id="page-title">
        <h1 class="pull-left">{{moduleName}} <span>create&nbsp;a&nbsp;data</span></h1>
    </header>

    <section id="main-content">
        <div id="page-actions" class="clearfix">
            <btn-actions>
                <button class="btn btn-small" ng-click="exit()">Back</button>
                <button class="btn btn-small btn-primary" data-indi-click="saveAndView()">Save</button>
                <button class="btn btn-small btn-primary" data-indi-click="saveAndBack()">Save & Back</button>
            </btn-actions>
        </div>

        <div class="row-fluid">
            <section class="edit-mode span12">
                @using (Html.BeginFormAntiForgeryPost(Url.Action("Create", new { Id = typeName, ReturnUrl = Request.QueryString["ReturnUrl"] }),
                                                          FormMethod.Post, new { @class = "form-horizontal", @name = "myForm" })) {
                    @Html.ValidationSummary()
                    // Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type


                    Output.Write(Model.Layout);
                }
            </section>
        </div>
    </section>
</section>
@Display(Model)
